<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PointLion | JFinalOA</title>
    #include("/common/include/include.html")
    <script src="#(ctx)/common/js/demo/nifty-demo.js"></script>
    <script src="#(ctx)/common/plugins/morris-js/morris.min.js"></script>
	<script src="#(ctx)/common/plugins/morris-js/raphael-js/raphael.min.js"></script>
    <script src="#(ctx)/common/plugins/sparkline/jquery.sparkline.min.js"></script>
    <style>
    </style>
</head>
<body style="padding-top:10px;">
    <div> 
        <div>
            <div id="pjax-container">
						<div id="page-content">
								<div class="col-sm-12">
							        <div class="panel">
							            <form id="editForm" class="panel-body form-horizontal form-padding">
				                		        <div class="form-group">
										        		<label class="col-sm-2 control-label">起始年月：</label>
										        		<div class="col-sm-10">
												        	<div class="select pull-left">
										                        <select id="startYear">
										                            #for(year:yearList)	
										                            	<option value="#(year)">#(year)</option>
										                            #end
										                        </select>
										                    </div>
										                    <div class="select pull-left">
										                        <select id="startMonth">
										                           <option value="01">01</option>
										                           <option value="02">02</option>
										                           <option value="03">03</option>
										                           <option value="04">04</option>
										                           <option value="05">05</option>
										                           <option value="06">06</option>
										                           <option value="07">07</option>
										                           <option value="08">08</option>
										                           <option value="09">09</option>
										                           <option value="10">10</option>
										                           <option value="11">11</option>
										                           <option value="12">12</option>
										                        </select>
										                    </div>
										                    <div style="float: left;line-height: 10px;padding: 10px;">
										                        	至
										                    </div>
										                    <div class="select pull-left">
										                        <select id="endYear">
										                            #for(year:yearList)	
										                            	<option value="#(year)">#(year)</option>
										                            #end
										                        </select>
										                    </div>
										                    <div class="select pull-left">
										                        <select id="endMonth">
										                           <option value="01">01</option>
										                           <option value="02">02</option>
										                           <option value="03">03</option>
										                           <option value="04">04</option>
										                           <option value="05">05</option>
										                           <option value="06">06</option>
										                           <option value="07">07</option>
										                           <option value="08">08</option>
										                           <option value="09">09</option>
										                           <option value="10">10</option>
										                           <option value="11">11</option>
										                           <option value="12">12</option>
										                        </select>
										                    </div>
									                    </div>
								                    </div>
								                    <div class="form-group">
											        	<label class="control-label col-sm-2" >验证码：</label>
											        	<div class="col-sm-10">
											        		<input type="text" placeholder="请输入验证码" id="valicode" class="form-control" style="width:150px;display: inline;">
												            <input type="hidden" value="#(id)" id="websiteid">
												        	<img alt="验证码出错啦~!" src="#(ctx)#(valicode)">
											        	</div>
											        </div>
											        <div class="form-group">
											        	<label class="control-label col-sm-2"></label>
											        	<div class="col-sm-10">
													        <button class="btn btn-primary" onclick="getdata()" type="button">确定</button>
											        	</div>
											        </div>
										        </div>
							            </form>
							        </div>
							    </div>
						</div>
            </div>
        </div>
    </div>
    
    <script>
		function getvalicode(){
			return $("#valicode").val();
		}
		function getdata(){
			var startYear = $("#startYear").val(); 
			var startMonth = $("#startMonth").val();
			var endYear = $("#endYear").val();
			var endMonth = $("#endMonth").val();
			var s = startYear+startMonth;
			var e = endYear+endMonth;
			if(s>e){
				layer.alert("开始年月不能大于结束年月")
				return;
			}
			var id = $("#websiteid").val();
			var code = $("#valicode").val();
			if(!code){
				layer.alert("验证码不能为空！");
				return;
			}
			var start = startYear+"-"+startMonth;
			var end = endYear+"-"+endMonth;
			var loadingIndex = pointLion.loading();
			setTimeout(function(){
				var data = common_ajax.ajaxFunc("/admin/grap/business/qilushihuaHuanbaoshuiGetData",{"valicode":code,"id":id,"start":start,"end":end}, "json", null);
				if(data.success){
					layer.close(loadingIndex);
					var index = parent.layer.getFrameIndex(window.name); 
				    parent.execBatchImport();
				    parent.layer.close(index);
				}else{
					layer.close(loadingIndex);
					layer.alert("获取数据失败");
				}
			},200);
		}
		$(document).ready(function() {
			
		});
	</script>
</body>
</html>